package com.Sing.Service;

import com.Sing.Dao.AdminMapper;
import com.Sing.Pojo.Admin;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.HashMap;

public class AdminServiceImpl implements AdminService {
    private AdminMapper mapper;
    @Autowired
    public void setMapper(AdminMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public Admin getDataByCheck(String username, String password) {
        return mapper.getDataByCheck( username, password );
    }

    @Override
    public boolean modifyPWD(String password, String oldPassword) {
        return mapper.modifyPWD( password, oldPassword );
    }

    @Override
    public ArrayList<Admin> getAllDataByCheck(String username, int adminType) {
        return mapper.getAllDataByCheck( username, adminType );
    }

    @Override
    public ArrayList<Admin> getAllData() {
        return mapper.getAllData();
    }

    @Override
    public boolean deleteDataById(int id) {
        return mapper.deleteDataById( id );
    }

    @Override
    public boolean modifyPWDById(String password, int id) {
        return mapper.modifyPWDById(password, id);
    }

    @Override
    public Admin getDataByID(int id) {
        return mapper.getDataByID(id);
    }

    @Override
    public boolean addAdmin(HashMap<String, Object> paramMap) {
        return mapper.addAdmin(paramMap);
    }

    @Override
    public int getAllDataContext(String username, int adminType) {
        return mapper.getAllDataContext(username, adminType);
    }
}
